import { request } from '@/util/request' // 导入 Axios 实例

//注册接口
export function register(data: object) {
  return request({
    url: '/virtual/user/register',
    method: 'post',
    data: data,
  })
}
//登录接口
export function login(data: object) {
  return request({
    url: '/virtual/user/login',
    method: 'post',
    data: data,
  })
}
export function sendVerificationCode(phone: string) {
  return request({
    url: '/virtual/user/getCaptcha',
    method: 'get',
    params: {
      // 自动拼接到URL
      phone: phone,
    },
  })
}
export function verifyCaptcha(data: any) {
  return request({
    url: '/virtual/user/verifyCaptcha',
    method: 'post',
    params: data,
  })
}
export function checkUsernameExists(data: any) {
  return request({
    url: '/virtual/user/checkUsernameExists',
    method: 'get',
    params: {
      username: data,
    },
  })
}
